package com.cheng.commonutlis.mvvm.activity;

import android.util.Log;
import android.view.View;

import com.cheng.commonutlis.R;
import com.cheng.commonutlis.databinding.ActivityMvvmBinding;
import com.cheng.commonutlis.mvvm.base.BaseActivity;
import com.cheng.commonutlis.mvvm.viewmodel.MvvmVM;

public class MvvmActivity extends BaseActivity<MvvmVM, ActivityMvvmBinding> {

    @Override
    protected int loadLayoutResId() {
        return R.layout.activity_mvvm;
    }

    private static final String TAG = "MvvmActivity";
    @Override
    protected void afterCreate() {
        binding.setTitle("你大爷");
        binding.setUserVM(mViewModel);
        binding.mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mViewModel.getUser();
            }
        });
        binding.myText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Log.d(TAG, "onClick: ===================");
                showTooltip("textViewClick");
            }
        });
    }
}
